package wangshuai.risk.action;

import javax.annotation.Resource;

import publics.model.Application;

import wangshuai.risk.service.EnterpriseRiskService;
import com.opensymphony.xwork2.ActionSupport;

import fanjingzhu.check.service.ApplicationService;

//测试用
public class EnterpriseRiskAction extends ActionSupport {
	private static final long serialVersionUID = 1L;
	
	private EnterpriseRiskService  enterpriseRiskService;// 注入enterpriseRiskServiceImpl
	private ApplicationService applicationService;

	public EnterpriseRiskService getEnterpriseRiskService() {
		return enterpriseRiskService;
	}
	@Resource(name="enterpriseRiskService")
	public void setEnterpriseRiskService(
			EnterpriseRiskService enterpriseRiskService) {
		this.enterpriseRiskService = enterpriseRiskService;
		System.out.println("enterpriseRiskServiceImpl Inject  in EnterpriseRiskAction !");
	}
	public ApplicationService getApplicationService() {
		return applicationService;
	}
	@Resource(name="applicationService")
	public void setApplicationService(ApplicationService applicationService) {
		this.applicationService = applicationService;
	}
	
	private Application application;
	private String  result;
	
	public String execute() throws Exception {
		
		if(!enterpriseRiskService.riskAnalyze(1)){//测试用，传值为1
			System.out.println("enterpriseRiskAction内   分析失败！！");;
		}
		application = this.getApplicationService().findById(1);
		result = application.getDescribe();
		return SUCCESS;
	}

	
	
	public Application getApplication() {
		return application;
	}
	public void setApplication(Application application) {
		this.application = application;
	}
	/**
	 * @return the result
	 */
	public String getResult() {
		return result;
	}
	/**
	 * @param result the result to set
	 */
	public void setResult(String result) {
		this.result = result;
	}
	

}
